﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Migration.Entity;
using Migration.DBUtility;
using JJY.DBUtility;

namespace Migration.DataAccess
{
    public class MenuItemDataAccess
    {
        public int Insert(MenuItem menuItem)
        {
            string sql = string.Format("INSERT INTO MenuItem(MenuText, ParentId, WithPage, PageContent) " + 
                " VALUES('{0}',{1},{2},'{3}')", menuItem.MenuText, menuItem.ParentId, menuItem.WithPage, menuItem.PageContent);

            return MigrationDbHelper.ExcuteNonQuery(sql);
        }

        public int GetMainMenu()
        {
            string sql = string.Format("SELECT * FROM MenuItem WHERE ParentId IS NULL");
            return SQLEntityHelper<MenuItem>
        }
    }
}
